package com.team.sns.persistence;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;

import com.team.sns.entities.QueryResult;

public interface Persistence<T> {
	public void clear();

	public void save(T obj);

	public void update(T obj);

	public void delete(Serializable id);

	public void delete(Serializable... ids);

	public T findById(Serializable id);

	public List<Object[]> queryByHql(String hql);

	public Long getCount();

	public Long getCount(String whereHql, Object[] params);

	public List<T> getResultList();

	public List<T> getResultList(int startIndex, int maxResult);

	public List<T> getResultList(int startIndex, int maxResult, String whereHql, Object[] params);

	public List<T> getResultList(int startIndex, int maxResult, LinkedHashMap<String, String> orderBy);

	public List<T> getResultList(int startIndex, int maxResult, String whereHql, Object[] params,
			LinkedHashMap<String, String> orderBy);

	public QueryResult<T> getScrollData();

	public QueryResult<T> getScrollData(int startIndex, int maxResult);

	public QueryResult<T> getScrollData(int startIndex, int maxResult, String whereHql, Object[] params);

	public QueryResult<T> getScrollData(int startIndex, int maxResult, LinkedHashMap<String, String> orderBy);

	public QueryResult<T> getScrollData(int startIndex, int maxResult, String whereHql, Object[] params,
			LinkedHashMap<String, String> orderBy);
}
